<?php
class TDataTableVagasContrato extends TDataTable
{    
    /**
     * Construtor
     * @param $operador
     * @param $options
     */
    public function __construct( $contratoid, $options = NULL )
    {
        $model = new ViewVagasContratoRelatorio();
        $key = 'vagaid';
        $criterio = array();
        $columns = array();
        
        if ( $options == NULL ) {
            $options = array();
        }                      

        $options['itensPerPage'] = -1;
        
        $criterio['precondicao'] = 'contratoid = ' . $contratoid;
        
        $colunas = array();
		$filtersCombo = array();
		
	    $colunas[] = array('header'=> 'ID','name'=>'vagaid');
		$colunas[] = 'cargo';
		$colunas[] = 'lotacao';
		$colunas[] = 'nucleogestor';
		$colunas[] = array('header'=> 'Salario','name'=>'salario','mask'=>TDataTableColumn::MASK_MONEY);
		$colunas[] = array('header'=> 'Salario Bruto','name'=>'salariobruto','mask'=>TDataTableColumn::MASK_MONEY);
		
		//Status da VAGA
		//$colunas[] = array('header'=> 'Status','name'=>'statusvaga');
		
		$colunas[] = array('header'=> 'cpf','name'=>'cpf','mask'=>TDataTableColumn::MASK_CPF);
		$colunas[] = 'candidato';
		$colunas[] = array('header'=> 'Status Candidato','name'=>'statuscandidato');
		
    	$filtersCombo = array('cargo', 'lotacao','statusvaga', 'statuscandidato' );
		
        $criterio['orderBy'] = 'vagaid';
                
        parent::__construct($model, $key, $criterio, $options, $columns);
        
        $this->addColumnsData( $colunas );
        $this->addFiltersCombo( $filtersCombo );
        
    }    
}